package top.lixunda.commerce.gateway.gateway.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.annotation.Order;
import org.springframework.web.server.WebFilter;
import top.lixunda.commerce.gateway.gateway.filter.AccessLogWebFilter;
import top.lixunda.commerce.gateway.gateway.filter.CorsWebFilter;

/**
 * @author LiXunda
 * @version time:2019/8/31 20:25
 */
@Configuration
public class WebFilterConfig {

    @Bean
    @Order(-10000)
    public WebFilter accessLogWebFluxFilter() {
        return new AccessLogWebFilter();
    }

    @Bean
    public WebFilter corsGlobalFilter() {
        return new CorsWebFilter();
    }

}
